import request from "@/services";

// 获取歌单详情API
export const getPlaylistDetailAPI = (id: number) => {
  return request.get<any>({
    url: "/playlist/detail",
    params: {
      id
    }
  })
}

// 获取用户歌单
export const getUserPlaylisAPI = (uid: number, limit = 1) => {
  return request.get<any>({
    url: '/user/playlist',
    params: {
      uid,
      limit
    }
  })
}

// 获取用户专辑
export const getDigitalAlbumPurchasedAPI = () => {
  return request.get<any>({
    url: '/digitalAlbum/purchased'
  })
}

// 关注的歌手列表
export const getArtistSublistAPI = () => {
  return request.get<any>({
    url: '/artist/sublist'
  })
}

// 收藏的mv
export const getMvSublistAPI = () => {
  return request.get<any>({
    url: '/mv/sublist'
  })
}

// 云盘
export const getUserCloudAPI = (limit: number, offset: number) => {
  return request.get<any>({
    url: '/user/cloud',
    params: {
      limit,
      offset
    }
  })
}

// 云盘歌曲详情
export const getUserCloudDetailAPI = (id: number) => {
  return request.get<any>({
    url: '/user/cloud/detail',
    params: {
      id
    }
  })
}

// 获取最近播放歌曲
export const getUserRecordAPI = (uid: number, type: number) => {
  return request.get<any>({
    url: '/user/record',
    params: {
      uid,
      type
    }
  })
}